package com.wanxi.service.front.impl;

import com.wanxi.dao.front.TypeDao;
import com.wanxi.domain.front.TypeModel;
import com.wanxi.domain.product.ProductModel;
import com.wanxi.service.front.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeDao typeDao;

    @Override
    public int deleteByid(int id) {
        int num = typeDao.deleteById(id);
        return num;
    }

    @Override
    public List<TypeModel> findAll(Integer page, Integer limit) {
        List<TypeModel> productModels = typeDao.findAll(page, limit);
        return productModels;
    }

    @Override
    public int insert(TypeModel typeModel) {
        int num = typeDao.insert(typeDao);
        /*ResultModel resultModel = new ResultModel();
        if (num > 0) {
            resultModel.setMsg("success");
            resultModel.setData(num);
        } else {
            resultModel.setMsg("error");
        }*/

        return num;
    }
}
